using System;
using System.ServiceModel;

namespace RemoteWorker.Server
{
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, IncludeExceptionDetailInFaults = true,  AutomaticSessionShutdown = false)]
    public class WorkerManager : IWorkerManager
    {
        private WorkerServer _workerServer;

        public WorkerManager(WorkerServer workerServer)
        {
            _workerServer = workerServer;
        }

        public bool CheckWorker(string workerName)
        {
            return _workerServer.CheckWorker(workerName);
        }

        public void Execute(string workerName, string fileName, string args)
        {
            _workerServer.Execute(OperationContext.Current.GetCallbackChannel<INantTask>(),workerName,fileName,args);
        }
    }
}